using UnityEngine;

namespace Jerry.UiFrame
{
    public class CoroutineTool : MonoBehaviour
    {
        private static CoroutineTool _instance;

        public static CoroutineTool Instance
        {
            get
            {
                if(_instance == null)
                {
                    GameObject gameObject = new GameObject
                    {
                        name = "CoroutineTool"
                    };
                    _instance = gameObject.AddComponent<CoroutineTool>();
                    DontDestroyOnLoad(_instance);
                }
                return _instance;
            }
        }
        private void OnDestroy()
        {
            _instance = null;
        }
    }
}